package com.tngames.angrytunisian.game.core;

import static playn.core.PlayN.*;

import playn.core.Game;
import playn.core.Image;
import playn.core.ImageLayer;

public class AngryTunisianGame implements Game {

	private Splashscreen splashscreen;
	private AngryTunisianGameEngine engine;
	public GameScreen delegate;

	@Override
	public void init() {
		// create and add background image layer
//		Image bgImage = assets().getImage("images/bg.png");
//		ImageLayer bgLayer = graphics().createImageLayer(bgImage);
//		graphics().rootLayer().add(bgLayer);
//		splashscreen = new Splashscreen(this);
//        delegate = splashscreen;
        
        engine = new AngryTunisianGameEngine(this);
		this.delegate = engine;
	}

	@Override
	public void paint(float alpha) {
		// the background automatically paints itself, so no need to do anything
		// here!
	}

	@Override
	public void update(float delta) {
		delegate.update(delta);
	}

	@Override
	public int updateRate() {
		return 25;
	}

	public void splashscreenDone() {
		engine = new AngryTunisianGameEngine(this);
		this.delegate = engine;
	}
}
